import { createRouter, createWebHistory } from 'vue-router';
import LoginView from '../views/LoginView.vue';
import RegisterView from '../views/RegisterView.vue';
import HotelPage from '../views/HotelPage.vue' // 酒店页面
import TrainList from '../views/TrainList.vue' // 酒店页面

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      redirect: '/login',
    },
    {
      path: '/login',
      name: 'login',
      component: LoginView,
    },
    {
      path: '/register',
      name: 'register',
      component: RegisterView,
    },
    {
      path: '/home',
      name: 'HomeView',
      component: () => import('@/views/HomeView.vue')
    },
    { path: '/hotel',
      name: 'HotelPage',
      component: HotelPage
    },
    {
      path: '/meal',
      name: 'TrainMeal',
      component: () => import('@/views/TrainMeal.vue')
    },
    {
      path: '/history',
      name: 'HistoryOrder',
      component: () => import('@/views/HistoryOrder.vue')
    },
    {
      path: '/train-list',
      name: 'TrainList',
      component: TrainList
    },
    {
      path: '/wallet',
      name: 'Wallet',
      component: () => import('@/views/MyWallet.vue') // 或根据你的目录结构调整路径
    },
    {
      path: '/center',
      name: 'PersonalCenter',
      component: () => import('@/views/PersonalCenter.vue') // 或根据你的目录结构调整路径
    },
    {
      path: '/messages',
      name: 'Messages',
      component: () => import('@/views/MessageCenter.vue')
    },
    {
      path: '/trainBooking',
      name: 'TrainBooking',
      component: () => import('@/views/TrainBooking.vue')
    }
  ],
});

export default router;
